package com.yootk;
import java.io.File;
public class test2 {
    public static void main(String[] args) throws Exception {
        File file = new  File ("H:" + File.separator);
        info(file);
    }
    public static void info(File file) {
        if (file.isDirectory()) {
            File list [] = file.listFiles((f) -> file.isDirectory() ? true :
                    file.getName().endsWith(".txt"));
            if (list!=null) {
                for (File temp : list){
                    info(temp);
                }
            }
        } else{
                System.out.println(file);
            }
        }
    }
